import {axios, reqPost, loginreq, reqGet} from './httpFun';

/**
* ${table.comment!}
**/
// 分页获取分页列表
export const pageList${table.entityName} = (params) => { return reqGet("/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/pageList",params) };
// 获取列表
export const list${table.entityName} = (params) => { return reqGet( "/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/list", params) };
// 保存（添加编辑）
export const save${table.entityName} = (params) => { return reqPost("/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/save", params) };
// 删除
export const delete${table.entityName} = (params) => { return axios.delete("/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/delete?ids=" + params)};
// 启停用
export const use${table.entityName} = (params) => { return reqPost("/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/use", params) };
// 根据ID查询
export const get${table.entityName} = (params) => { return reqGet("/api<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if
controllerMappingHyphenStyle??>${table.entitySourceName}<#else>${table.entityPath}</#if>/getById", params) };


/**
* 路由配置
// ${table.comment!}
import ${table.entityName} from '@/views/${table.entityName}';


,{
path: '/${table.name}',
name: '${table.comment!}',
component: ${table.entityName},
meta: {
requireAuth: true
}
}
* 菜单新增数据
INSERT INTO `js_menu`(`title`, `url`, `type`, `level`, `platform`, `remark`, `operator_id`, `parent_id`,
`gmt_create`) VALUES
('${table.comment!}', '/${table.name}', 'path', 2, 'MANAGER', '${table.comment!}', 1, 1, NOW());

*/
